#file myclient

import threading


class myclient(threading.Thread):
    def __init__(self, conn, addr):
        threading.Thread.__init__(self, name=str(addr[0]))
        self.conn = conn;
        self.addr = addr;
        print '--->; Connection received from:', addr[0], addr[1]
    
    def run(self):
        while 1:
            packet = self.conn.recv(1024)
            if not packet:
                print '--->; %s:%s closed\n' % (addr[0], addr[1])
                break
            else:
                self.conn.send(packet)

#end file myclient